package com.yl.chainStore.pojo.vo.pay

import com.baomidou.mybatisplus.annotation.TableField
import com.yl.chainStore.common.Constants
import java.math.BigDecimal
import java.util.*


/**
 * 保存订单使用vo
 */
data class PayCustomerOrderSaveVo(

    var id : Long ?= null,

    var customerId:Long,

    var details:List<PayCustomerOrderDetailSaveVo>?= null,

    var createTime:Date = Date(),

    var originalPrice:Long ?= null,
){
    /**
     * 整单折扣价格用
     */
    @TableField(exist = false)
    var originalPriceShow: BigDecimal? = null
        set(value) {
            if (value != null) {
                originalPrice = (value.multiply(BigDecimal(Constants.OtherConfig.MONEY_TO_DB_DOUBLE))).toLong()
                field = value
            }
        }
}
